package com.dongdongshop.service.impl;

import com.dongdongshop.mapper.TbSellerMapper;
import com.dongdongshop.pojo.TbSeller;
import com.dongdongshop.service.TbSellerService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
@com.alibaba.dubbo.config.annotation.Service
public class TbSellerServiceImpl implements TbSellerService {

    @Autowired
    private TbSellerMapper tbSellerMapper;

    @Override
    public int tbSellerService(TbSeller tbSeller) {
        int i = tbSellerMapper.insertSelective(tbSeller);
        return i;
    }

    @Override
    public TbSeller selectByid(String username) {
        TbSeller tbSeller = tbSellerMapper.selectByPrimaryKey(username);
        return tbSeller;
    }

    @Override
    public List<TbSeller> selectss() {
        List<TbSeller> tbSellers = tbSellerMapper.selectByExample(null);

        return tbSellers;
    }

    @Override
    public List<TbSeller> selectBysellerId(String selectByid) {
        return null;
    }

    @Override
    public Boolean updata(String sellerId, String status) {
        TbSeller tbSeller = new TbSeller();
        tbSeller.setSellerId(sellerId);
        tbSeller.setStatus(status);
        int i = tbSellerMapper.updateByPrimaryKeySelective(tbSeller);
        return i>0;
    }
}
